<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <head>
        <th:block th:include="include :: header('修改系统')"/>
        <th:block th:include="include :: select2-css"/>
    </head>
</head>

<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-application-edit" th:object="${applications}">
        <input name="appCode" type="hidden" th:field="*{appCode}"/>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>系统名称：</label>
                    <div class="col-sm-8">
                        <input name="appName" th:field="*{appName}" placeholder="请输入系统名称" class="form-control"
                               type="text" required autocomplete="off"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>部署地址：</label>
                    <div class="col-sm-8">
                        <input name="appUri" th:field="*{appUri}" placeholder="请输入应用部署地址" class="form-control"
                               type="text" required autocomplete="off"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>系统类型：</label>
                    <div class="col-sm-8">
                        <select name="appType" class="form-control m-b"
                                th:with="type=${@dict.getType('sys_application_type')}">
                            <option th:each="appType : ${type}"
                                    th:text="${appType.dictLabel}"
                                    th:value="${appType.dictValue}"
                                    th:field="*{appType}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">序号：</label>
                    <div class="col-sm-8">
                        <input name="sort" th:field="*{sort}" placeholder="请输入序号" class="form-control" type="text"
                               autocomplete="off"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">地址：</label>
                    <div class="col-xs-10">
                        <input name="appAddress" th:field="*{appAddress}" maxlength="255" class="form-control"
                               autocomplete="off"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">备注：</label>
                    <div class="col-xs-10">
                        <textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script>
    var prefix = ctx + "system/application";

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-application-edit").serializeArray();
            $.operate.save(prefix + "/edit", data);
        }
    }

</script>
</body>
</html>